export default class ColorUtil {
    // 深蓝
    static blueDeep = 'blueDeep'
    // 亮绿
    static greenLight = 'greenLight'
    // 深灰
    static greyDeep = 'greyDeep'
    // 黄色
    static yellow = 'yellow'
    // 红色
    static red = 'red'
    // 浅蓝
    static blueLight = 'blueLight'
    // 深紫
    static purpleDeep = 'purpleDeep'
    // 橙色
    static orange = 'orange'
    // 深绿
    static greenDeep = 'greenDeep'
    // 紫色
    static purple = 'purple'

    static primary = 'primary'
    static error = 'error'
    static warn = 'warn'
    static success = 'success'
    static info = 'info'

    static colorClass: string [] = [
      ColorUtil.primary,
      ColorUtil.warn,
      ColorUtil.error,
      ColorUtil.success,
      ColorUtil.info
    ]

    static echarts_colors: string [] = [
      '#5b8ff9',
      '#38d193',
      '#626c91',
      '#f6bd15',
      '#e86552',
      '#30b1e0',
      '#6a23cc',
      '#ff9844',
      '#1d9493',
      '#ba40d9'
    ]

    static colors: string [] = [
      ColorUtil.blueDeep,
      ColorUtil.greenLight,
      ColorUtil.greyDeep,
      ColorUtil.yellow,
      ColorUtil.red,
      ColorUtil.blueLight,
      ColorUtil.purpleDeep,
      ColorUtil.orange,
      ColorUtil.greenDeep,
      ColorUtil.purple
    ]

    static getColorByIndex(index): string {
      return ColorUtil.colorClass[(index + 1) % ColorUtil.echarts_colors.length]
    }

    static getBgColorClassByIndex(index): string {
      return 'bg-' + ColorUtil.colorClass[(index + 1) % ColorUtil.colorClass.length]
    }

    // 获取行checkbox 颜色
    static getCheckedBoxClass(row, index): string {
      if (index < 5) {
        return row.checked
          ? 'checkbox-bg-' + ColorUtil.colors[index]
          : 'checkbox-border-' + ColorUtil.colors[index]
      }
      return
    }
}
